<?php
if (isset($this->ekstensi)){
	$ekstensi = $this->ekstensi;
}
$filename = "supp".Session::get('kd_satker').date("dmYHis");
$filenames = $filename.$ekstensi;

header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment;Filename=".$filenames);

echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
echo "<SUPPLIERs>\n";
if (isset($this->data)){
		foreach ($this->data as $value){
			echo "<SUPPLIER>\n";
			echo "<nama_supplier>".trim($value->get_nama_supplier_alt())."</nama_supplier>\n";
			echo "<npwp>".trim($value->get_npwp_supplier())."</npwp>\n";
			echo "<no_supplier>".trim($value->get_v_supplier_number())."</no_supplier>\n";
			echo "<kode_satker>".trim($value->get_satker())."</kode_satker>\n";
			echo "<ubah_supplier></ubah_supplier>\n";
			echo "<tidak_aktif_supplier></tidak_aktif_supplier>\n";
			echo "<nama_site>".trim($value->get_tipe_supp())."</nama_site>\n";
			echo "<kode_negara>".trim($value->get_negara())."</kode_negara>\n";
			echo "<kode_kppn>".trim($value->get_kppn_code())."</kode_kppn>\n";
			echo "<alamat1>".trim($value->get_alamat())."</alamat1>\n";
			echo "<alamat2></alamat2>\n";
			echo "<kota>".trim($value->get_city())."</kota>\n";
			echo "<propinsi>".trim($value->get_provinsi())."</propinsi>\n";
			echo "<email>".trim($value->get_email())."</email>\n";
			echo "<no_telpon>".trim($value->get_phone())."</no_telpon>\n";
			echo "<kode_pos>".trim($value->get_zip())."</kode_pos>\n";
			echo "<kode_tipe_supplier>".substr(trim($value->get_tipe_supp()),0,1)."</kode_tipe_supplier>\n";
            echo "<ubah_site></ubah_site>\n";
            echo "<tidak_aktif_alamat></tidak_aktif_alamat>\n";
			echo "<kode_negara_asal_bank>".trim($value->get_asal_bank())."</kode_negara_asal_bank>\n";
			echo "<kode_bank>".trim($value->get_kd_bank())."</kode_bank>\n";
			echo "<nama_bank>".trim($value->get_nm_bank())."</nama_bank>\n";
			echo "<kode_swift>".trim($value->get_kd_swift())."</kode_swift>\n";
			echo "<nama_cabang_bank>".trim($value->get_cabang())."</nama_cabang_bank>\n";
            echo "<alamat_bank></alamat_bank>\n";
			echo "<nama_pemilik_rekening>".trim($value->get_nm_pemilik_rek())."</nama_pemilik_rekening>\n";
			echo "<no_rekening>".trim($value->get_norek_bank())."</no_rekening>\n";
			echo "<iban>".trim($value->get_iban())."</iban>\n";
			echo "<mata_uang>".trim($value->get_kdvalas())."</mata_uang>\n";
            echo "<detail_nama_cabang_bank></detail_nama_cabang_bank>\n";
			echo "<nama_pegawai_pemda_penerusan_pinjaman>";
            if(substr(trim($value->get_tipe_supp()),0,1)!=1){
                trim($value->get_nm_penerima());
            }
            echo "</nama_pegawai_pemda_penerusan_pinjaman>\n";
			echo "<npwp1>".trim($value->get_npwp_penerima())."</npwp1>\n";
			echo "<nip>".trim($value->get_nip_penerima())."</nip>\n";
            echo "<lokasi></lokasi>\n";
            echo "<alamat1_2></alamat1_2>\n";
            echo "<alamat2_2></alamat2_2>\n";
            echo "<kota1></kota1>\n";
            echo "<propinsi1></propinsi1>\n";
            echo "<kode_pos1></kode_pos1>\n";
            echo "<kode_negara1></kode_negara1>\n";
            echo "<ubah_bank></ubah_bank>\n";
            echo "<tidak_aktif_rekening></tidak_aktif_rekening>\n";
            echo "<email_satker></email_satker>\n";
			echo "<kode_sandi>".trim($value->get_kode_sandi())."</kode_sandi>\n";
			echo "</SUPPLIER>\n";
	}
}
echo "</SUPPLIERs>\n";
?>